<!--
  User: Kuttubek Aidaraliev
  Date: 06.04.2010
  Time: 15:51:24
-->
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j"
    template="../../WEB-INF/jspx/common/template.xhtml">

    <ui:define name="head">
        <title>
            <h:outputText value="#{messages.vacancyList}" />
        </title>
    </ui:define>

    <ui:define name="body">
      <h3 align="center"><h:outputText value="#{messages.vacancyList}" /></h3>
      <h:form>
         <h:commandButton value="#{messages.create}" action="#{vacancyBeanController.preInsert}"/>
      </h:form>
         <rich:spacer height="10" width="100%" />
         <!--<rich:datascroller for="vacancyListBeanId" align="left" rendered="#{not empty vacancyBeanController.vacancyDataModel}"/>-->
         <rich:dataTable
                   value="#{vacancyBeanController.realList}"
                   var="vacancy"
                   width="100%"
                   binding="#{vacancyBeanController.dataTable}"
                   id="vacancyListBeanId">

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.title}" />
                </f:facet>
                <h:outputText value="#{vacancy.title}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.customer}"/>
                </f:facet>
                <h:outputText value="#{vacancy.customer.codeName}" />
             </rich:column>

              <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.datePublish}"/>
                </f:facet>
                <h:outputText value="#{vacancy.datePublish}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.applicant}"/>
                </f:facet>
                <h:outputText value="#{vacancy.applicant.title}" />
             </rich:column>

              <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.operation}"/>
                </f:facet>
                  <h:form>
                    <h:commandLink action="#{vacancyBeanController.view}">
                        <h:outputText value="#{messages.view}" />
                        <f:setPropertyActionListener value="#{vacancy}" target="#{vacancyBeanController.entity}"/>
                    </h:commandLink>
                  </h:form>
                  <rich:spacer height="10" width="20" />
                  <h:form>
                      <h:commandLink action="#{vacancyBeanController.preUpdate}">
                         <h:outputText value="#{messages.edit}" />
                         <f:setPropertyActionListener value="#{vacancy}" target="#{vacancyBeanController.entity}"/>
                      </h:commandLink>
                  </h:form>
                  <rich:spacer height="10" width="20"/>
                  <a4j:region>
                      <a4j:form>
                           <a4j:htmlCommandLink id="delete" action="#{vacancyBeanController.deleted}">
                                <h:outputText value="#{messages.delete}" />
                                <f:setPropertyActionListener value="#{vacancy}" target="#{vacancyBeanController.entity}"/>
                           </a4j:htmlCommandLink>
                      </a4j:form>
                  </a4j:region>
             </rich:column>

             <!--<rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.delete}"/>
                </f:facet>
                 <h:commandLink action="#{vacancyBeanController.deleted}">
                    <h:outputText value="#{messages.delete}" />
                    <f:setPropertyActionListener value="#{vacancy}" target="#{vacancyBeanController.vacancy}"/>
                 </h:commandLink>
             </rich:column> -->

         </rich:dataTable>
  </ui:define>
</ui:composition>